export interface msgDataItem {
  id: string;
  content: string;
  type: string;
  status: boolean;
  collected: boolean;
  date: string;
  quality: string;
}
// 定义的state初始值
const state: { msgData: Array<msgDataItem> } = {
  msgData: [
    {
      id: '125',
      content: '👋亲爱的朋友们，一场小猫救助活动正在进行中！让我们一起行动，给这些无助的一点帮助...',
      type: '救助动态',
      status: true,
      collected: false,
      date: '2023-01-01 08:00',
      quality: 'middle',
    },
    {
      id: '123',
      content: '🟣用户15165655888申请线上申请云领养',
      type: '领养动态',
      status: true,
      collected: false,
      date: '2023-01-01 08:00',
      quality: 'high',
    },
    {
      id: '124',
      content: '✨第十三次田化村救助活动评分已更新',
      type: '评分动态',
      status: true,
      collected: false,
      date: '2023-01-01 08:00',
      quality: 'low',
    },
    {
      id: '126',
      content: '🟢第十三次田化村救助活动义工招募时间截至',
      type: '义工招募动态',
      status: true,
      collected: false,
      date: '2023-01-01 08:00',
      quality: 'low',
    }
  ],
};

const mutations = {
  setMsgData(state, data) {
    state.msgData = data;
  },
};

const getters = {
  unreadMsg: (state) => state.msgData.filter((item) => item.status),
  readMsg: (state) => state.msgData.filter((item) => !item.status),
};

const actions = {};

export default {
  namespaced: true,
  state,
  mutations,
  actions,
  getters,
};
